package com.cet.spring_batch_study.jobs.endOfDay;

import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.StepExecutionListener;
import org.springframework.batch.core.annotation.AfterStep;

/**
 * @author NSOC
 */
public class EndOfDayStepExecutionListener implements StepExecutionListener {

    @Override
    public void beforeStep(StepExecution stepExecution) {
        System.out.println(stepExecution.getCreateTime());
    }

    @Override
    public ExitStatus afterStep(StepExecution stepExecution) {
        System.out.println(stepExecution.getStepName());
        return StepExecutionListener.super.afterStep(stepExecution);
    }
}
